package pl.wr.particle.impl.matter.elementary.fermions.quarks;

import pl.wr.math.number.Fraction;
import pl.wr.particle.def.matter.IParticle;
import pl.wr.particle.def.matter.elementary.bosons.gauge.IWBoson;
import pl.wr.particle.def.matter.elementary.fermions.quarks.IDown;
import pl.wr.particle.impl.Particle;
import pl.wr.particle.impl.matter.composite.hadrons.baryons.nucleons.Neutron;
import pl.wr.particle.impl.matter.elementary.bosons.gauge.WBoson;
import pl.wr.physics.units.others.e;

/**
 * @version 1.0
 * @author wieslaw.rodak
 *
 */
public class Down extends Quark implements IDown {
	
	private static final String DOWN = "down";
	private static final String ANTI_DOWN = "antiDown";
//	public final String symbol;
	public final String name;

	public Down() {
		this(false);
	}
	
	public Down(boolean isAntiParticle) {
		super();
		
		if (isAntiParticle){
			this.getProperties().setElementaryCharge(new e(1,3));
			this.getProperties().setIsospin(new Fraction(1,2));
//			symbol ="_d";
			name = ANTI_DOWN;
//			setFlavour(Flavour.D);
		}else{
			this.getProperties().setElementaryCharge(new e(-1,3));
			this.getProperties().setIsospin(new Fraction(-1,2));
//			symbol = "d";
			name = DOWN;
//			setFlavour(Flavour.D);
			Object o = symbol;
		}
	}

	@Override
	public IParticle[] fusion(IParticle[] particles) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public IParticle[] decay() {

		//if parent is Neutron
		if(this.getParentParticle().getClass().isInstance(Neutron.class)){
			
		}
		carringParticles = new Particle[2];
		carringParticles[0] = new Up();
		final IWBoson boson = new WBoson();
		boson.getProperties().setElementaryCharge(new e(-1));
		carringParticles[1] = boson;
		
		this.removeFromSpace();
		return carringParticles;
	}

}
